#CACHE{0}
<?php
    include_spip('functions/pdk_common');
    include_spip('inc/minipres');
    $extension = pdk_load_class('AlohacartPaymentLiqpay', 'classes/payment');
    $order_mdl = pdk_load_class('AlohacartOrderModel', 'classes');
	$xml_decoded = base64_decode(_request('operation_xml'));
	$id_order = $extension->GetTag($xml_decoded, 'order_id');
	$status = $extension->GetTag($xml_decoded, 'status');
    if ($_REQUEST && $extension->CheckSignature($_REQUEST) && $status=='success' && $id_order) {
        $extension->PaymentSuccess($id_order, $_REQUEST);            
        echo minipres('<:alohacart_payment_liqpay:payment_succes:>', 
            '<div style="text-align:center;"><a href="#URL_SITE_SPIP"><:alohacart:go_to_main_page:></a></div>');
    } else {
        echo minipres('<:alohacart_payment_liqpay:payment_failed:><br />'._request('message'), 
            '<div style="text-align:center;"><a href="#URL_SITE_SPIP"><:alohacart:go_to_main_page:></a></div>');
    } 
?>